package org.afun.oldhand.user.activity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;
import android.util.Log;
import android.view.View;

import org.afun.oldhand.R;
import org.afun.oldhand.user.adapter.UserBasicInformationAdapter;
import org.afun.oldhand.user.adapter.UserBasicInformationAdapter.OnBasicinformtionItemClickListener;
import org.afun.oldhand.user.adapter.UserYouhuiquanAdapter;
import org.afun.oldhand.user.javabean.Youhuiquan;

import java.util.ArrayList;
import java.util.List;

public class user_item1_2 extends AppCompatActivity {

    private List<Youhuiquan> data = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_item12);
        initView();
    }

    private void initView() {
        RecyclerView recyclerView = findViewById(R.id.youhuiquanRV);
        data.add(new Youhuiquan(R.drawable.user_youhuiquan_cantuse));
        data.add(new Youhuiquan(R.drawable.user_youhuiquan_unuse));
        data.add(new Youhuiquan(R.drawable.user_youhuiquan_used));


        RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
        recyclerView.setLayoutManager(layoutManager);

        UserYouhuiquanAdapter userYouhuiquanAdapter = new UserYouhuiquanAdapter(data,this);
        recyclerView.setAdapter(userYouhuiquanAdapter);

        userYouhuiquanAdapter.setUserYouhuiquanItemClickListener(new UserYouhuiquanAdapter.OnUserYouhuiquanItemRecyclerItemClickListener() {
            @Override
            public void onItemRecyclerItemClick(int position) {
                Log.e("textYouhuiquan", "onItemRecyclerItemClick: "+position);
            }
        });

    }


}